
<div class="main-content">
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="#">首页</a>
            </li>

            <li>
                <a href="#">wifi管理</a>
            </li>
            <li class="active">wifi管理</li>
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">
								<span class="input-icon">
									<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
									<i class="icon-search nav-search-icon"></i>
								</span>
            </form>
        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="page-header">
            <h1>
                wifi管理
                <small>
                    <i class="icon-double-angle-right"></i>
                    wifi管理
                </small>
            </h1>
        </div><!-- /.page-header -->
        <button class="btn btn-info" type="button">
            <i  {if condition="input('param.type','1') eq 1"}class="icon-ok bigger-110"{else /}class=" bigger-110"{/if} ></i>
            <a href="{:url('active/index',['type'=>1])}" style="color:#fff">后台发布数据</a>
        </button>
        <button class="btn btn-info" type="button">
            <i {if condition="input('param.type','1') eq 2"}class="icon-ok bigger-110"{else /}class=" bigger-110"{/if}></i>
            <a href="{:url('active/index',['type'=>2])}" style="color:#fff">用户提交数据</a>
        </button>
        <p>
            <button class="btn btn-danger btn-block" onclick="urlTo();">添加wifi
            </button>
        </p>
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->

                <div class="row">
                    <div class="col-xs-12">
                        <div class="table-responsive">
                            <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th class="center">
                                        <label>
                                            <input type="checkbox" class="ace" />
                                            <span class="lbl"></span>
                                        </label>
                                    </th>
                                    <th>Id</th>
                                    <th>活动logo</th>
                                    <th>wifi名称</th>
                                    <th>wifi地点</th>
                                    <th>分数</th>
                                    <th>运行起始日期</th>
                                    <th>wifi状态</th>
                                    <!--<th>是否显示</th>-->
                                    {if condition="input('param.type','1') eq 2"}
                                    <th>是否审核</th>
                                    {/if}
                                    <th>操作</th>
                                </tr>
                                </thead>

                                <tbody>
                                {foreach name="list" item="vo"}
                                <tr>
                                    <td class="center">
                                        <label>
                                            <input type="checkbox" class="ace" />
                                            <span class="lbl"></span>
                                        </label>
                                    </td>
                                    <td>
                                        <a href="#">{$vo.id}</a>
                                    </td>
                                    <td>
                                        {if condition="$vo.type eq 1"}
                                        <img src="__PUBLIC__upload/IMG_01.png" width="50px" height="50px"/>
                                        {else /}
                                        <img src="__PUBLIC__upload/IMG_00.jpg" width="50px" height="50px"/>
                                        {/if}
                                    </td>
                                    <td>{$vo.name}</td>
                                    <td>
                                        <a href="#">{$vo.address}</a>
                                    </td>
                                    <td>
                                        <a href="#">{$vo.report}</a>
                                    </td>
                                    <td class="hidden-480">{:date("Y-m-d H:i:s",$vo['addtime'])}</td>
                                    <td>
                                        <div class="col-xs-3">
                                            <label>
                                                <input name="switch-field-1" class="ace ace-switch ace-switch-6" sx="{$vo.is_zc}" onclick="changeValue(this,{$vo.id})"
                                                       {if condition="$vo.is_zc eq 0"} checked {/if}
                                                type="checkbox" />
                                                <span class="lbl"></span>
                                            </label>
                                        </div>
                                    </td>
                                    {if condition="input('param.type','1') eq 2"}
                                    <td>
                                        <div class="col-xs-3">
                                            <label>
                                                <input name="switch-field-1" class="ace ace-switch ace-switch-6" sx="{$vo.is_view}" onclick="changeValue1(this,{$vo.id})"
                                                       {if condition="$vo.is_view eq 1"} checked {/if}
                                                type="checkbox" />
                                                <span class="lbl"></span>
                                            </label>
                                        </div>
                                    </td>
                                    {/if}
                                    <td>
                                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                                            <!--<button class="btn btn-xs btn-success" data-url="{:url('active/create')}">
                                               <i class="icon-ok bigger-120"></i>
                                            </button>-->

                                            <button class="btn btn-xs btn-info" onclick="editTable(this,'{$vo.id}')">
                                                <i class="icon-edit bigger-120"></i>
                                            </button>

                                            <button class="btn btn-xs btn-danger" onclick="deleteTable(this,'{$vo.id}')">
                                                <i class="icon-trash bigger-120"></i>
                                            </button>

                                            <!--<button class="btn btn-xs btn-warning">
                                                <i class="icon-flag bigger-120"></i>
                                            </button>-->
                                        </div>

                                        <div class="visible-xs visible-sm hidden-md hidden-lg">
                                            <div class="inline position-relative">
                                                <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
                                                    <i class="icon-cog icon-only bigger-110"></i>
                                                </button>

                                                <ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
                                                    <li>
                                                        <a href="{:url('active/create')}" class="tooltip-info" data-rel="tooltip" title="View">
																				<span class="blue">
																					<i class="icon-zoom-in bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>

                                                    <li>
                                                        <a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																				<span class="green">
																					<i class="icon-edit bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>

                                                    <li>
                                                        <a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
																				<span class="red">
																					<i class="icon-trash bigger-120"></i>
																				</span>
                                                        </a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                                <script>
                                    function editTable(obj,id){
                                        location.href="{:url('active/update')}?id="+id;
                                    }
                                    function deleteTable(obj,id){
                                        location.href="{:url('active/delete')}?id="+id;
                                    }
                                </script>
                                </tbody>
                            </table>
                        </div><!-- /.table-responsive -->
                    </div><!-- /span -->
                </div><!-- /row -->

                <div class="hr hr-18 dotted hr-double"></div>
                <div>
                    {$list->render();}
                </div>

            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
</div><!-- /.main-content -->

<script>
    function urlTo(){
        location.href="{:url('active/create')}";
    }
</script>
<script>
    function changeValue(obj,id){
        var url = "{:url('active/ajaxChange')}";
        var val = $(obj).attr('sx');
        if (val == 1) {
            $.post(url, {sx: val, id: id});
            $(obj).attr('sx', '0');

        } else {
            $.post(url, {sx: val, id: id});
            $(obj).attr('sx', '1');
        }
    }
    function changeValue1(obj,id){
        var url = "{:url('active/ajaxChange1')}";
        var val = $(obj).attr('sx');
        if (val == 1) {
            $.post(url, {sx: val, id: id});
            $(obj).attr('sx', '0');

        } else {
            $.post(url, {sx: val, id: id});
            $(obj).attr('sx', '1');
        }
    }
</script>